#!/usr/bin/sh

elf=$1

patchelf --replace-needed ld-linux-riscv64-lp64.so.1 librt.so.1 $elf
for lib in libawtk.so libmvvm.so
do
    origin_lib=`patchelf --print-needed $elf | grep $lib`
    echo replace: $origin_lib to $lib
    patchelf --replace-needed $origin_lib $lib $elf
done

echo needed libs:
patchelf --print-needed $elf